package com.wkk.mapper;

import com.wkk.entity.*;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ChatMapper {
    //chat_record表
    int insertRecord(ChatRecord chatRecord);

    int deleteRecord(Integer crid);

    ChatRecord selectRecordById(Integer crid);

    List<ChatRecord> selectListRecord();

    List<ChatRecord> selectListRecordByUid(Integer uid);

    List<ChatRecord> selectListRecordByUidAttention(Integer uid);

    int updateRecordStateById(ChatRecord chatRecord);

    int updateRecordLikeCountById(Integer crid);

    int updateRecordCommentCountById(Integer crid);

    int updateRecordForwardCountById(Integer crid);

    //chat_record_picture
    int insertRPicture(ChatRecordPicture chatRecordPicture);

    int deleteRPictureByCRid(Integer crid);

    int deleteRPictureById(Integer crpid);

    List<ChatRecordPicture> selectPictureByCRid(Integer crid);

    //chat_like
    int insertLike(ChatLike chatLike);

    int deleteLike(ChatLike chatLike);

    int deleteLikeByCRid(Integer crid);

    int getLikeCountByCRid(Integer crid);

    List<ChatLike> selectLikeByUid(Integer uid);

    //chat_comment
    int insertComment(ChatComment chatComment);

    int deleteCommentByCRid(Integer crid);

    int deleteCommentByCCid(Integer ccid);

    List<ChatComment> selectCommentsByUid(Integer uid);

    List<ChatComment> selectCommentsByCRid(Integer crid);

    //chat_user
    int insertFan(ChatUser chatUser);

    int deleteFan(ChatUser chatUser);

    int getFanCountOnStar(Integer star);

    List<ChatUser> queryChatUsersByUid(Integer uid);

    //chat_authority
    int insertAuthority(ChatAuthority chatAuthority);

    int updateAuthority(ChatAuthority chatAuthority);

    int deleteAuthorityByUid(Integer uid);

    ChatAuthority selectUserAuthority(Integer uid);

}
